package com.hk.controller;

import com.hk.common.ResponseResult;
import com.hk.model.vo.analyze.*;
import com.hk.service.SpaceAnalyzeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author huangkun
 * @date 2025/1/18 14:13
 */
@RestController
@RequestMapping("/space/analyze")
//@Api(value = "空间分析", tags = "空间分析")
public class SpaceAnalyzeController {

    @Resource
    private SpaceAnalyzeService spaceAnalyzeService;


    @ApiOperation(value = "空间使用情况分析")
    @PostMapping("/use/analyze")
    public ResponseResult<SpaceAnalyzeResponseVO> spaceAnalyze(@RequestBody SpaceAnalyzeRequestVO analyzeRequestVO) {
        SpaceAnalyzeResponseVO analyzeResponseVO = spaceAnalyzeService.spaceAnalyze(analyzeRequestVO);
        return ResponseResult.success(analyzeResponseVO);
    }

    @ApiOperation(value = "空间图片分类使用情况分析")
    @PostMapping("/category/analyze")
    public ResponseResult<List<CategoryAnalyzeResponseVO>> categoryAnalyze(@RequestBody SpaceAnalyzeRequestVO analyzeRequestVO) {
        List<CategoryAnalyzeResponseVO> list = spaceAnalyzeService.categoryAnalyze(analyzeRequestVO);
        return ResponseResult.success(list);
    }


    @ApiOperation(value = "空间图片标签使用情况分析")
    @PostMapping("/tag/analyze")
    public ResponseResult<List<TagAnalyzeResponseVO>> tagAnalyze(@RequestBody SpaceAnalyzeRequestVO analyzeRequestVO) {
        List<TagAnalyzeResponseVO> list = spaceAnalyzeService.tagAnalyze(analyzeRequestVO);
        return ResponseResult.success(list);
    }

    @ApiOperation(value = "空间图片大小分布情况分析")
    @PostMapping("/size/analyze")
    public ResponseResult<List<PictureSizeAnalyzeResponseVO>> pictureSizeAnalyze(@RequestBody SpaceAnalyzeRequestVO analyzeRequestVO) {
        List<PictureSizeAnalyzeResponseVO> list = spaceAnalyzeService.pictureSizeAnalyze(analyzeRequestVO);
        return ResponseResult.success(list);
    }

}
